﻿@using Pyramid.Extentions
@using Pyramid.Models
@using Pyramid.Mvc.Html
@model IEnumerable<Customer>

@{
	var bag = (PagerModel) ViewBag.Bag;
	var qm = (CustomerQueryModel) ViewBag.QueryModel;
}

@using (Html.BeginForm("List", "CustomerHealth", FormMethod.Post, new {id = "pagerForm"}))
{
	<input type="hidden" name="pageNum" value="1" />
	<input type="hidden" name="numPerPage" value="${model.numPerPage}" />
}
<div class="pageHeader">
	@using (Html.BeginForm("List", "CustomerHealth", FormMethod.Post, new {onsubmit = "return navTabSearch(this);"}))
	{
		<div class="searchBar">
			<table class="searchContent">
				<tr>
					<td>顾客编码：<input type="text" name="staffCode" rel="pagerForm" value="@qm.CustomerCode" /></td>
					<td>顾客姓名：<input type="text" name="keywords" rel="pagerForm" value="@qm.Keywords" /></td>
				</tr>
			</table>
		</div>
		<div class="subBar">
			<table>
				<tr>
					<td>建档日期从  
						<input type="text" name="createTimeFrom" class="date" readonly="readonly" rel="pagerForm" value="@Html.DateString(qm.CreateTimeFrom)" />
						至 
						<input type="text" name="createTimeTo" class="date" readonly="readonly" rel="pagerForm"  value="@Html.DateString(qm.CreateTimeTo)"/>
					</td>
					<td>&nbsp;&nbsp;</td>
					<td>
						<div class="buttonActive">
							<div class="buttonContent">
								<button type="submit">查询</button>
							</div>
						</div>
					</td>
				</tr>
			</table>
		</div>
	}
</div>
<div class="pageContent">
	<table class="table" width="100%" layouth="110">
		<thead>
			<tr>
				<th width="100">@Html.DisplayNameFor(m => m.Code)</th>
				<th width="120">@Html.DisplayNameFor(m => m.FullName)</th>
				<th width="80">@Html.DisplayNameFor(m => m.Gender)</th>
				<th width="150">@Html.DisplayNameFor(m => m.Profession)</th>
				<th width="150">@Html.DisplayNameFor(m => m.Education)</th>
				<th width="150">@Html.DisplayNameFor(m => m.RevenueLevel)</th>
				<th width="120">@Html.DisplayNameFor(m => m.IdCard)</th>
				<th width="80">@Html.DisplayNameFor(m => m.CardType)</th>
				<th width="80">@Html.DisplayNameFor(m => m.Mobile)</th>
				<th></th>
			</tr>
		</thead>
		<tbody>
			@foreach (var s in Model)
			{
				<tr>
					<td>@s.Code</td>
					<td>@s.FullName</td>
					<td>@s.GenderString</td>
					<td>@s.Profession</td>
					<td>@s.Education</td>
					<td>@s.RevenueLevelString</td>
					<td>@s.IdCard</td>
					<td>@s.CardTypeEnum.ToDescription()</td>
					<td>@s.Mobile</td>
					<td>@Html.ActionLink("健康档案", "HealthIndex", new { id = s.Id }, new { target = "navTab", title = string.Format("{0}的健康档案", s.FullName), rel = string.Format("tab_ccm_health_{0}", s.Id) })</td>
				</tr>
			}
		</tbody>
	</table>
	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<select class="combox" name="numPerPage" onchange=" navTabPageBreak({ numPerPage: this.value }) ">
				<option value="20">20</option>
				<option value="50">50</option>
				<option value="100">100</option>
				<option value="200">200</option>
			</select>
			<span>条，共 @bag.TotalCount 条</span>
		</div>
		<div class="pagination" targettype="navTab" totalcount="@bag.TotalCount" numperpage="@bag.PageSize" pagenumshown="10" currentpage="@bag.CurrentPageIndex"></div>
	</div>
</div>